/**
 * Ant Design Pro v4 use `@ant-design/pro-layout` to handle Layout.
 *
 * @see You can view component api by: https://github.com/ant-design/ant-design-pro-layout
 */

  import ProLayout, { DefaultFooter,PageContainer } from '@ant-design/pro-layout';
  import React from 'react';
  import { Link } from 'umi';
  import {createFromIconfontCN} from '@ant-design/icons';
  import styles from './index.less'
  
//   import Icon from '@/a'
//   import RightContent from '@/components/GlobalHeader/RightContent';
  const IconFont = createFromIconfontCN({
    scriptUrl:'iconfont.js'
  })
 
  
  const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
    const {
      children,
      location = {
        pathname: '/',
      },
    } = props;
  
    // const { formatMessage } = useIntl();
    return (
      <ProLayout
      contentStyle={{height: '100vh'}}
      {...props}
      style={{...styles}}
      navTheme='light'
        menuItemRender={(menuItemProps,defaultDom) => {
            if (
                menuItemProps.isUrl ||
                !menuItemProps.path 
              ) {
                return defaultDom;
              }
              return <Link to={menuItemProps.path}>{menuItemProps.pro_layout_parentKeys && menuItemProps.pro_layout_parentKeys.length > 0 && <IconFont type={menuItemProps.icon.toString()} />}{defaultDom}</Link>;
        }}
        subMenuItemRender={(item,dom)=>{
           return dom
        }}
        menuExtraRender={()=>{
            return <div style={{height:'40px',display:'flex'}}>
                <div style={{width:'40px',margin:'0 10px 0 5px'}}>
                    <img style={{display:'block',width:'40px',height:'40px',borderRadius:'50%'}} src="https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg2.niutuku.com%2Fdesk%2F1208%2F0731%2Fbizhi-0731-7777.jpg&refer=http%3A%2F%2Fimg2.niutuku.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1658939236&t=281a9d5eb543ecff5b630b989d389eb4" alt="" />
                </div>
               <h4 style={{flex: '70%'}}>我是 kuku</h4>
            </div>
        }}
        // headerRender={()=><div style={{backgroundColor: '#fff'}}>1</div>}
        fixSiderbar
        fixedHeader
        // rightContentRender={() => <RightContent />}
      >
       {children}
      </ProLayout>
    );
  };
  
  export default BasicLayout;